//logs.js
const util = require('../../utils/util.js')
const app = getApp()

Page({
  data: {
    logs: [],
    userInfo: {}
  },
  onLoad: function () {
  
    this.setData({
      userInfo:  wx.getStorageSync('userInfo'),
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return util.formatTime(new Date(log))
      })
    })

  },
  loginOut:function(){
    //清除用户数据
    wx.clearStorageSync('userInfo');
    wx.clearStorage();
    // app.globalData.userInfo = {};
    wx.reLaunch({
      url: '../login/login',
    })

  }
})
